package com.guyaning.deyson_core.core.app;

import com.guyaning.deyson_core.core.utils.stroage.LattePreference;

/**
 * Created by Administrator on 2018/5/5.
 */

public class AccountManager {

    private enum SignTag {
        SIGN_TAG
    }

    //登录成功之后，保存登录状态
    public static final void setSignTag(boolean state) {
        LattePreference.setAppFlag(SignTag.SIGN_TAG.name(), state);
    }

    public static final boolean isSignIn() {
        return LattePreference.getAppFlag(SignTag.SIGN_TAG.name());
    }

    public static void checkAccount(IUserChecker userChecker) {
        if (isSignIn()) {
            userChecker.onSignIn();
        } else {
            userChecker.onNotSignIn();
        }
    }
}
